package com.tianhui.consignortwofei.pattern.orderOprate;

import com.tianhui.consignortwofei.R;
import com.tianhui.consignortwofei.mvp.model.enty.OrderInfo;
import com.tianhui.consignortwofei.mvp.model.enty.OrderOperateInfo;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.AdjustPriceOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.AdjustQuantityOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.AdjustRoadOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.AdjustWeightOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.RevocationOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.ShareOrderOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.SourceDetailOperate;
import com.tianhui.consignortwofei.pattern.orderOprate.impl.TerminateSourceOperate;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fgs
 * @date 2020/8/30
 * @description
 **/
public class SourceOperateList implements IOperateList {
    @Override
    public List<OrderOperateInfo> getTopOperateList(OrderInfo orderInfo) {
        List<OrderOperateInfo> list = new ArrayList<>();
        OrderOperateInfo operateInfo;

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "调整价格";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_adjust_price;
        operateInfo.iOrderOperate = new AdjustPriceOperate();
        list.add(operateInfo);

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "调整重量";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_adjust_weight;
        operateInfo.iOrderOperate = new AdjustWeightOperate();
        list.add(operateInfo);

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "调整数量";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_adjust_quantity;
        operateInfo.iOrderOperate = new AdjustQuantityOperate();
        list.add(operateInfo);

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "调度明细";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_dispatch_detail;
        operateInfo.iOrderOperate = new SourceDetailOperate();
        list.add(operateInfo);

        return list;
    }

    @Override
    public OrderOperateInfo getBottomCenterOperateInfo(OrderInfo orderInfo) {
        return null;

    }

    @Override
    public OrderOperateInfo getTopCenterOperateInfo(OrderInfo orderInfo) {
        return null;
    }

    @Override
    public List<OrderOperateInfo> getBottomOperateList(OrderInfo orderInfo) {
        List<OrderOperateInfo> list = new ArrayList<>();
        OrderOperateInfo operateInfo;

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "单据撤销";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_order_revocation;
        operateInfo.iOrderOperate = new RevocationOperate();
        list.add(operateInfo);

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "终止单据";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_order_terminate;
//        operateInfo.type = 0;
        operateInfo.iOrderOperate = new TerminateSourceOperate();
        list.add(operateInfo);

        operateInfo = new OrderOperateInfo();
//        operateInfo.operate = "路耗调整";
        operateInfo.operate = "修改备注";
        operateInfo.orderInfo = orderInfo;
        operateInfo.operateImageId = R.mipmap.icon_adjust_road;
        operateInfo.iOrderOperate = new AdjustRoadOperate();
        list.add(operateInfo);

        operateInfo = new OrderOperateInfo();
        operateInfo.operate = "分享订单";
        operateInfo.operateImageId = R.mipmap.icon_order_share;
        operateInfo.orderInfo = orderInfo;
        operateInfo.iOrderOperate = new ShareOrderOperate();
        list.add(operateInfo);

        return list;
    }
}
